<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>22_节点操作-修改节点</title>
    </head>
    <body>
        <ul>
            <li>小舞</li>
            <li>宁荣荣</li>
            <li>朱竹青</li>
            <li id="l4">比比东</li>
        </ul>

        <script>
            var li_new = document.createElement('li');
            li_new.innerHTML = '千仞雪';

            var li_old = document.querySelector('#l4');

            var ul = document.querySelector('ul');

            ul.replaceChild(li_new,li_old);
        </script>
    </body>
</html>